package com.lcq.price.controller;

import com.lcq.course.entity.Good;
import com.lcq.price.client.CourseListClient;
import com.lcq.price.entity.GoodPrice;
import com.lcq.price.service.GoodPriceService;
import feign.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class GoodsPriceController {

    @Autowired
    GoodPriceService  goodPriceService;
    @Autowired
    CourseListClient courseListClient;

    @GetMapping("/price")
    public GoodPrice getGoodPriceById(int id){
        return  goodPriceService.getGoodPriceById(id);
    }

    @GetMapping("/price/list")
    public Good getGoodListById(@Param("id") int id){
       return courseListClient.getGoodById(id);
    }



}
